//
//  Area Model.m
//  OC05-HomeWork!(周六)
//
//  Created by dllo on 16/7/9.
//  Copyright © 2016年 高雅馨. All rights reserved.
//

#import "Area Model.h"

@implementation Area_Model
// 实例方法,self代表实例对象(调用者)
- (instancetype)initWithName:(NSString *)name {
    return [self initWithName:name number:nil];
}
// 类方法中,self代表类对象本身
+ (instancetype)area_ModelWithName:(NSString *)name{
    return [[self alloc] initWithName:name];
}
// 指派初始化
- (instancetype)initWithName:(NSString *)name number:(NSString *)number {
    self = [super init];
    if (self) {
        _name = name;
        _number = number;
    }
    return self;
}
+ (instancetype)area_ModelWithName:(NSString *)name number:(NSString *)number
{
    return [[self alloc] initWithName:name number:number];
}
- (instancetype)initWithTempCity:(TempCity *)tempCity{
        return [self initWithName:tempCity.cityName number:tempCity.cityNumber];
}
+ (instancetype)area_ModelWithTempCity:(TempCity *)tempCity{
    return [[self alloc] initWithTempCity:tempCity];
}
@end
